//
//  MainViewController.swift
//  CWLiving
//
//  Created by 方正刚 on 2017/7/4.
//  Copyright © 2017年 方正刚. All rights reserved.
//

import UIKit

class MainViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        addChildVC(stotyName: "Home")
        addChildVC(stotyName: "Live")
        addChildVC(stotyName: "Follow")
        addChildVC(stotyName: "Profile")
    
    }

    func addChildVC(stotyName : String) {
        
        /// 通过storyboard获取控制器
        let childVC = UIStoryboard(name: stotyName, bundle: nil).instantiateInitialViewController()!
        
        /// childVC作为子控制器
        addChildViewController(childVC)
        
    }

  

}
